import { request } from "./request";

// 获取教材详情


export const writingList = async (data) => {
    return await request(
      { url: "/api/writing", method: "post" },
      {
        data,
      }
    );
};
export const detail = async (data) => {
    return await request(
      { url: "/api/writing/detail", method: "post" },
      {
        data,
      }
    );
};

export const chapterlist = async (data) => {
    return await request(
      { url: "/api/writing/chapterlist", method: "post" },
      {
        data,
      }
    );
};
export const chapterdetail = async (data) => {
    return await request(
      { url: "/api/writing/chapterdetail", method: "post" },
      {
        data,
      }
    );
};



//音标
export const soundmarkList = async (data) => {
    return await request(
      { url: "/api/soundmark", method: "post" },
      {
        data,
      }
    );
};

export const writingDetail = async (data) => {
    return await request(
      { url: "/api/soundmark/detail", method: "post" },
      {
        data,
      }
    );
};
export const writingChapterlist = async (data) => {
    return await request(
      { url: "/api/soundmark/chapterlist", method: "post" },
      {
        data,
      }
    );
};
export const soundmarkChapterdetail = async (data) => {
    return await request(
      { url: "/api/soundmark/chapterdetail", method: "post" },
      {
        data,
      }
    );
};
export const soundmarkQuestions = async (data) => {
    return await request(
      { url: "/api/soundmark/questions", method: "post" },
      {
        data,
      }
    );
};



//典范
export const modelspList = async (data) => {
    return await request(
      { url: "/api/modelsp", method: "post" },
      {
        data,
      }
    );
};
//典范
export const modelspDetail = async (data) => {
    return await request(
      { url: "/api/modelsp/detail", method: "post" },
      {
        data,
      }
    );
};

export const modelspChapterlist= async (data) => {
    return await request(
      { url: "/api/modelsp/chapterlist", method: "post" },
      {
        data,
      }
    );
};
export const modelspChapterdetailt= async (data) => {
    return await request(
      { url: "/api/modelsp/chapterdetail", method: "post" },
      {
        data,
      }
    );
};



//新概念
export const newconceptList= async (data) => {
    return await request(
      { url: "/api/newconcept", method: "post" },
      {
        data,
      }
    );
};

export const newconceptDetail= async (data) => {
    return await request(
      { url: "/api/newconcept/detail", method: "post" },
      {
        data,
      }
    );
};
export const newconceptChapterlist= async (data) => {
    return await request(
      { url: "/api/newconcept/chapterlist", method: "post" },
      {
        data,
      }
    );
};

export const newconceptChapterdetail= async (data) => {
    return await request(
      { url: "/api/newconcept/chapterdetail", method: "post" },
      {
        data,
      }
    );
};


//黑布林
export const blackplumList= async (data) => {
    return await request(
      { url: "/api/blackplum", method: "post" },
      {
        data,
      }
    );
};

export const blackplumDetail= async (data) => {
    return await request(
      { url: "/api/blackplum/detail", method: "post" },
      {
        data,
      }
    );
};
export const blackplumChapterlist= async (data) => {
    return await request(
      { url: "/api/blackplum/chapterlist", method: "post" },
      {
        data,
      }
    );
};

export const blackplumChapterdetail= async (data) => {
    return await request(
      { url: "/api/blackplum/chapterdetail", method: "post" },
      {
        data,
      }
    );
};



//解析json包 两种解析方式
export const commonQuestions= async (data) => {
  return await request(
    { url: `/api/common/questions`, method: "post" },
    {
      data,
    }
  );
};

export const questions= async (apiKey, data) => {
  return await request(
    { url: `/api/${apiKey}/questions`, method: "post" },
    {
      data,
    }
  );
};

//提交练习
export const saveExercise= async (data) => {
  return await request(
    { url: "/api/new_answer/saveExercise", method: "post" },
    {
      headers:{
        'Content-Type':'application/json'
      },
      data,
    }
  );
};
export const getExerciseDetail= async (data) => {
  return await request(
    { url: "/api/new_answer/getExerciseDetail", method: "post" },
    {
      data,
    }
  );
};
